package com.itheima.tlias84.po;

import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 更新学生参数
 */
@Data
public class UpdateStudentParam {
    private int id;
    @Length(min = 2, max = 10, message = "姓名长度必须在2-10之间")
    private String name;
    @Length(min = 10, max = 10, message = "学号必须是10位")
    private String no;
    private Integer gender;
    @Length(min = 11, max = 11, message = "手机号非法")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
    private String phone;
    @Length(min = 18, max = 18, message = "身份证号非法")
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$",
            message = "身份证号格式错误")
    private String idCard;
    private String isCollege;
    @Length(max = 100, message = "地址长度在0-100之间")
    private String address;
    private Integer degree;
    private LocalDate graduationDate;
    private Integer clazzId;
    private Integer violationCount;
    private Integer violationScore;
    private LocalDateTime updateTime;
}
